package com.sims.action.electricalFile;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.EfileResult;
import com.sims.bean.EfileVolunteer;
import com.sims.bean.ElectricalFile;
import com.sims.bean.Student;
import com.sims.service.ElectricalFileService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

public class ModifyElectricalFileAction extends ActionEnhanced{
	private Student student;
	private ElectricalFile electricalFile;
	private EfileResult efileResult;
	private EfileVolunteer efileVolunteer;
	
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	public ElectricalFile getElectricalFile() {
		return electricalFile;
	}
	public void setElectricalFile(ElectricalFile electricalFile) {
		this.electricalFile = electricalFile;
	}
	public EfileResult getEfileResult() {
		return efileResult;
	}
	public void setEfileResult(EfileResult efileResult) {
		this.efileResult = efileResult;
	}
	public EfileVolunteer getEfileVolunteer() {
		return efileVolunteer;
	}
	public void setEfileVolunteer(EfileVolunteer efileVolunteer) {
		this.efileVolunteer = efileVolunteer;
	}
	@Autowired
	private ElectricalFileService electricalFileService;
	@Override
	public String execute() {
		result = electricalFileService.modifyElectricalFile(student, electricalFile, efileResult, efileVolunteer);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
